<#include "../_inc/_layout.html"/> 
<#macro script>
function frozen(id){
	$.get("${CPATH}/admin/user/frozen?ucode=${ucode}&id="+id, function(data){
		if(data.errorCode > 0){
			toastr.error(data.message,'操作失败');
		}else{
			location.reload();
		}
	});
}

function restore(id){
	$.get("${CPATH}/admin/user/restore?ucode=${ucode}&id="+id, function(data){
		if(data.errorCode > 0){
			toastr.error(data.message,'操作失败');
		}else{
			location.reload();
		}
	});
}

function del(id){
	if(confirm("确定删除吗？")){
		$.get("${CPATH}/admin/user/delete?ucode=${ucode}&id="+id, function(data){
			if(data.errorCode > 0){
				toastr.error(data.message,'操作失败');
			}else{
				location.reload();
			}
		});
	}
}

function batchAction(){
	var roleSelect=$("#roleSelect").val();
	$("#form").attr("action","${CPATH}/admin/user/batchRole?role="+roleSelect+"");
	$("#form").ajaxSubmit({
		type : "post",
		dataType : "json",
		success : function(result) {
			if(result.errorCode > 0){
				toastr.error(result.message,'操作失败');
			}else{
				location.reload();
			}
		},
		error : function() {
			alert("信息提交错误");
		}
	});
}
</#macro> 
<@layout active_id=p child_active_id=c>
<#include include/>
</@layout>



